Workaround for "M-x man" on macOS 15 and later
authorEli Zaretskii <eliz@gnu.org>
Sat, 21 Jun 2025 09:33:12 +0000 (12:33 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 21 Jun 2025 09:33:12 +0000 (12:33 +0300)
* lisp/man.el (Man-init-defvars): Workaround for macOS Sed.  Do
not merge to master.  (Bug#77944)

lisp/man.el

index dcfab8d2035a1f738d5ebd4a8994592da49d5bde..50058d1426963c413a38778e9af47c8c05e6b0ed 100644 (file)
@@ -650,9 +650,12 @@ This is necessary if one wants to dump man.el with Emacs."
             (if Man-sed-script
                 (concat "-e '" Man-sed-script "'")
               "")
-             ;; Use octal numbers.  Otherwise, \032 (Ctrl-Z) would
-             ;; suspend remote connections.
-            "-e '/^[\\o001-\\o032][\\o001-\\o032]*$/d'"
+             (if (eq system-type 'darwin)
+                 ;; macOS Sed doesn't support \o notation.
+                 "-e '/^[[:cntrl:]][[:cntrl:]]*$/d'"
+               ;; Use octal numbers.  Otherwise, \032 (Ctrl-Z) would
+               ;; suspend remote connections.
+              "-e '/^[\\o001-\\o032][\\o001-\\o032]*$/d'")
             "-e '/\e[789]/s///g'"
             "-e '/Reformatting page.  Wait/d'"
             "-e '/Reformatting entry.  Wait/d'"